﻿#include "Card.h"
#include <iostream>

#define ╔ (char)201
#define ═ (char)205
#define ╗ (char)187
#define ║ (char)186
#define ╚ (char)200
#define ╝ (char)188
#define ░ (char)176

#define $a <<(char)(Card1.Symbol + 3)
#define $1 <<(char)Card1.Number
#define $b <<(char)(Card2.Symbol + 3)
#define $2 <<(char)Card2.Number
#define $c <<(char)(Card3.Symbol + 3)
#define $3 <<(char)Card3.Number

#define $DRAW std::cout
#define $s ' '
#define s " "
#define _n <<std::endl

using namespace std;

void ConvertSymbol(card& c)
{
	switch(c.Number)
	{
		case 10:
		{
			c.Number = 84;
			break;
		}
		case 11:
		{
			c.Number = 74;
			break;
		}
		case 12:
		{
			c.Number = 81;
			break;
		}
		case 13:
		{
			c.Number = 75;
			break;
		}
		case 1:
		{
			c.Number = 65;
			break;
		}
		default:
		{
			c.Number += 48;
			break;
		}
	}
}

void InitCard(card& c, int number,int symbol)
{
	c.Number = number;
	c.Symbol = symbol;
	ConvertSymbol(c);

	char sb = c.Symbol + 3;
	char nb = c.Number;

	c.D[0][0] = ╔ ;		c.D[0][1] = ║ ;		c.D[0][2] = ║ ;		c.D[0][3] = ║ ;		c.D[0][4] = ║ ; 	c.D[0][5] = ║ ; 	c.D[0][6] = ╚ ;
	c.D[1][0] = ═ ;		c.D[1][1] = sb ;	c.D[1][2] = nb;		c.D[1][3] = $s ;	c.D[1][4] = $s; 	c.D[1][5] = $s;		c.D[1][6] = ═ ; 
	c.D[2][0] = ═ ;		c.D[2][1] = $s ;	c.D[2][2] = $s ;	c.D[2][3] = $s ;	c.D[2][4] = $s ;	c.D[2][5] = $s ;	c.D[2][6] = ═ ; 
	c.D[3][0] = ═ ;		c.D[3][1] = $s ;	c.D[3][2] = $s ;	c.D[3][3] = sb ;	c.D[3][4] = $s ;	c.D[3][5] = $s ;	c.D[3][6] = ═ ; 
	c.D[4][0] = ═ ;		c.D[4][1] = $s ;	c.D[4][2] = $s ;	c.D[4][3] = $s ;	c.D[4][4] = $s ;	c.D[4][5] = $s ;	c.D[4][6] = ═ ; 
	c.D[5][0] = ═ ;		c.D[5][1] = $s ;	c.D[5][2] = $s ;	c.D[5][3] = $s ;	c.D[5][4] = nb ;	c.D[5][5] = sb ;	c.D[5][6] = ═ ;
	c.D[6][0] = ╗ ;		c.D[6][1] = ║ ;		c.D[6][2] = ║ ;		c.D[6][3] = ║ ;		c.D[6][4] = ║ ;		c.D[6][5] = ║ ;		c.D[6][6] = ╝ ; 
}